package com.iplant.ams.service.po.dms.maintenance;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 设备构型
 *
 * @author YouWang·Peng
 * 2023-8-2 17:43:36
 */
@DBBasePO(TableName = "dms_configuration", Schemas = DBSchemas.AMS, CheckName = {"Code", "DeviceID,Name"}, CodeAuto =
        true, CodePrefix = "DCN-", CodeNum = 4)
public class DMSConfiguration extends BasePO implements Serializable {
    /**
     * 序列号
     */
    private static final long serialVersionUID = 1L;

    /**
     * 设备ID
     **/
    @DBCondition
    @DBField
    public int DeviceID = 0;

    @DBJoin(name = "AssetInfoID", tableName = "dms_device_ledger", tableAsName = "dms_device_ledger1", Schemas =
            DBSchemas.AMS,
            MainTableField = "DeviceID")
    public int AssetInfoID = 0;

    /**
     * 设备名称
     **/
    @DBJoin(name = "Name", tableName = "ams_asset_list", tableAsName = "ams_asset_list1", Schemas = DBSchemas.AMS,
            JoinIndex = 2,
            ConditionalJoin = "dms_device_ledger1.AssetInfoID=ams_asset_list1.ID")
    public String DeviceName = "";
    /**
     * 设备编码
     **/
    @DBJoin(name = "Code", tableName = "ams_asset_list", tableAsName = "ams_asset_list1", Schemas = DBSchemas.AMS,
            JoinIndex = 2,
            ConditionalJoin = "dms_device_ledger1.AssetInfoID=ams_asset_list1.ID")
    public String DeviceCode = "";
    /**
     * 父级构型ID
     **/
    @DBField
    public int ParentID = 0;
    /**
     * 父级构型名称
     **/
    @DBJoin(name = "Name", tableName = "dms_configuration", tableAsName = "dms_configuration1", Schemas = DBSchemas.AMS,
            MainTableField = "ParentID")
    public String ParentName = "";
    /**
     * 父级构型编码
     **/
    @DBJoin(name = "Code", tableName = "dms_configuration", tableAsName = "dms_configuration1", Schemas = DBSchemas.AMS,
            MainTableField = "ParentID")
    public String ParentCode = "";
    /**
     * 子构型列表
     **/
    public List<DMSConfiguration> DMSConfigurationList = new ArrayList<>();
    /**
     * BOM列表
     **/
    public List<DMSDeviceBOM> DMSDeviceBOMList = new ArrayList<>();
    /**
     * 保养项目列表
     **/
    public List<DMSMaintenanceItem> MaintenanceItemList = new ArrayList<>();
    /**
     * 保养规则列表
     **/
    public List<DMSMaintenanceRule> MaintenanceRuleList = new ArrayList<>();

    public DMSConfiguration() {
    }

    public DMSConfiguration(int deviceID) {
        DeviceID = deviceID;
    }

    @JsonProperty("DeviceID")
    public int getDeviceID() {
        return DeviceID;
    }

    public void setDeviceID(int deviceID) {
        DeviceID = deviceID;
    }

    @JsonProperty("DeviceName")
    public String getDeviceName() {
        return DeviceName;
    }

    public void setDeviceName(String deviceName) {
        DeviceName = deviceName;
    }

    @JsonProperty("DeviceCode")
    public String getDeviceCode() {
        return DeviceCode;
    }

    public void setDeviceCode(String deviceCode) {
        DeviceCode = deviceCode;
    }

    @JsonProperty("ParentID")
    public int getParentID() {
        return ParentID;
    }

    public void setParentID(int parentID) {
        ParentID = parentID;
    }

    @JsonProperty("ParentName")
    public String getParentName() {
        return ParentName;
    }

    public void setParentName(String parentName) {
        ParentName = parentName;
    }

    @JsonProperty("ParentCode")
    public String getParentCode() {
        return ParentCode;
    }

    public void setParentCode(String parentCode) {
        ParentCode = parentCode;
    }

    @JsonProperty("DMSConfigurationList")
    public List<DMSConfiguration> getDMSConfigurationList() {
        return DMSConfigurationList;
    }

    public void setDMSConfigurationList(List<DMSConfiguration> DMSConfigurationList) {
        this.DMSConfigurationList = DMSConfigurationList;
    }

    @JsonProperty("DMSDeviceBOMList")
    public List<DMSDeviceBOM> getDMSDeviceBOMList() {
        return DMSDeviceBOMList;
    }

    public void setDMSDeviceBOMList(List<DMSDeviceBOM> DMSDeviceBOMList) {
        this.DMSDeviceBOMList = DMSDeviceBOMList;
    }

    @JsonProperty("MaintenanceItemList")
    public List<DMSMaintenanceItem> getMaintenanceItemList() {
        return MaintenanceItemList;
    }

    public void setMaintenanceItemList(List<DMSMaintenanceItem> maintenanceItemList) {
        MaintenanceItemList = maintenanceItemList;
    }

    @JsonProperty("MaintenanceRuleList")
    public List<DMSMaintenanceRule> getMaintenanceRuleList() {
        return MaintenanceRuleList;
    }

    public void setMaintenanceRuleList(List<DMSMaintenanceRule> maintenanceRuleList) {
        MaintenanceRuleList = maintenanceRuleList;
    }

    @JsonProperty("AssetInfoID")
    public int getAssetInfoID() {
        return AssetInfoID;
    }

    public void setAssetInfoID(int assetInfoID) {
        AssetInfoID = assetInfoID;
    }
}
